<?php
/**
 * Created by PhpStorm.
 * User: win7
 * Date: 2018/5/7
 * Time: 15:54
 */

namespace app\api\controller\v1;

use app\api\validate\IDCollection;
use app\api\model\Theme as ThemeModel;
use app\api\validate\IDMustBePositiveInt;
use app\lib\exception\ThemeException;

class Theme
{
    public function getSimpleList($ids = '') {
        (new IDCollection())->goCheck();
        $result = ThemeModel::getThemeByIDs($ids);
        if (!$result) {
            throw new ThemeException();
        }
        return $result;
    }
    public function getComplexOne($id) {
        (new IDMustBePositiveInt())->goCheck();
        $theme = ThemeModel::getThemeWithProducts($id);
        if (!$theme) {
            throw new ThemeException();
        }
        return $theme;
    }
    /*
     * 
     */
    public function getComplexOne() {
    	return 'success';
    }
}
